// pages/limit_sale_detail/limit_sale_detail.js
import {request} from "../../utils/request";

Page({

    /**
     * 页面的初始数据
     */
    data: {
        custom:wx.getMenuButtonBoundingClientRect(),
        list1:[], //授权城市
        list2:[], //意向城市
        list1_view:'',
        list2_view:'',
        letter:[],
        good_id:'',
        type:1, //查看的类型，1是授权城市；2是意向城市
        list:[],
        yx_num:'',
        sq_num:''
    },
    onLoad(options){
        this.setData({good_id:options.good_id,type:options.type})
        this.getDetail()
    },
    getDetail(){
        request({url:"/miniprogram/good/getGoodSoleList",data:{good_id:this.data.good_id}}).then(res=>{
            this.setData({list1:res.data.shouquan,list2:res.data.yixiang,yx_num:res.data.yx_num,sq_num:res.data.sq_num})
        })
    },
    changeType(e){
        this.setData({type:e.currentTarget.dataset.type})
    },
    onChange(e) {
        if(this.data.type == 1){
            this.setData({list1_view:(e.currentTarget.dataset.v != '#' ? e.currentTarget.dataset.v : 'jing')})
        }else{
            this.setData({list2_view:(e.currentTarget.dataset.v != '#' ? e.currentTarget.dataset.v : 'jing')})
        }

    },
})